package tests;

import client.ConsoleUI;

import common.Profile;

public class TestUI extends ConsoleUI {
    
    private static final long serialVersionUID = 1L;
    String userName;
    String password;
    int loginDecision;
    int gameTypeDecision;
    int number;
    int roomNumber;
    Profile NewUserProfile;
    boolean localGame = false;
    
    //a constructor for a test of guest player.
    TestUI(int loginDecision, int gameTypeDecision, int number, int roomNumber) {     
        this.loginDecision = loginDecision;
        this.number = number;
        this.gameTypeDecision = gameTypeDecision;
    }
    
    //a constructor for a test of a local game.
    TestUI(int number, String userName)
    {
        this.number = number;
        this.userName = userName;
        localGame = true;
    }
    
    //a constructor for a test of a login.
    TestUI(int loginDecision, int gameTypeDecision, int number, String userName, String password)
    {
        this.userName = userName;
        this.password = password;
        this.loginDecision = loginDecision;
        this.number = number;
        this.gameTypeDecision = gameTypeDecision;
    }
    
    //a constructor for a test for registration.
    TestUI(int loginDecision, int gameTypeDecision, int number, Profile NewUserProfile)
    {
        this.NewUserProfile = NewUserProfile;
        this.loginDecision = loginDecision;
        this.number = number;
        this.gameTypeDecision = gameTypeDecision;
    }
    
    public int getUserGameTypeDecision() 
    {
        if (localGame)
        {
            return 1;
        }
        else return 2;
    }
    
    public int getUserLoginDecision() {
        return loginDecision;
    }
    
    public Profile getRegistrationDetails()
    {   
        return this.NewUserProfile;        
    }
    

    public int getNumberOfPlayers()  {
        return number;
    }

    public String getPlayerName()  {
          return userName;
    }
    
    public String[] getLoginDetails(int tries)
    {
        String[] answer = new String[2];
        answer[0] = userName;
        answer[1] = password;
        return (answer);
    }

    public int getUserSetupDecision(boolean guest) {
        return gameTypeDecision;
    }

    public int getUserRoomDecision(int N) {
        return roomNumber;
    }
}